#include "controlpage.h"
#include "ui_controlpage.h"

ControlPage::ControlPage(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::ControlPage)
{
    ui->setupUi(this);
    _client = nullptr;
}

ControlPage::~ControlPage()
{
    delete ui;
}

void ControlPage::on_btnMove_clicked()
{qDebug()<<"click";
    if(_client){
        int x = ui->lineEditX->text().toUInt();
        int y = ui->lineEditY->text().toUInt();
        _client->getClientPtr()->writeCmd(QString("%1:%2:%3")
                          .arg("move")
                          .arg(x)
                          .arg(y));
    }
}
